/* ********** 合同明细 合同详情 相关 *********** */

import axios from '@/libs/request/axios'

// /contractDetail/detail
// 根据合同号码查询合同详细信息 contractBasic/contractDetail/detail?contractNo=sd
export const detail = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/detail`,
        method: 'POST',
        params: {
            contractNo
        },
    })
};

//  http://10.50.136.62:9999/contractBasic/contractDetail/list
// 多条件查询合同列表
export const list = (params) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/list`,
        method: 'POST',
        data: params
    })
};

// 根据合同号码查询车辆资产信息列表数据
export const carDetailsList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/custAssetInfo/getCustAssetInfoList`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询渠道信息
export const channelInfo = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/channelInfo`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询主共担地址信息(custRole 参数不传默认查询主借人)
export const custAddressInfoList = (contractNo, custRole = "MAIN_PERSON") => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custAddressInfoList`,
        method: 'POST',
        params: {contractNo, custRole}
    })
};

// 根据合同号码查询主借人/共借人/担保人基本信息(custRole  参数不传默认查询主借人的基本信息)
export const custBaseInfo = (contractNo, custRole = "MAIN_PERSON") => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custBaseInfo`,
        method: 'POST',
        params: {contractNo, custRole}
    })
};

// /根据合同号码查询主共担基本信息（多条数据，列表格式）
export const custBaseInfoList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custBaseInfoList`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询主共担联系电话信息（ custRole 参数不传默认查询主借人）
export const custContactInfoList = (contractNo, custRole = "MAIN_PERSON") => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custContactInfoList`,
        method: 'POST',
        params: {contractNo, custRole}
    })
};

// 根据合同号码查询紧急联系人信息
export const custContactsInfoList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custContactsInfoList`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询主借人/共借人/担保人详细信息（custRole参数不传默认查询主借人）
// contractBasic/contractDetail/custDetailInfo?contractNo=N111111&custRole=MAIN_PERSON
export const custDetailInfo = (contractNo, custRole = "") => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custDetailInfo`,
        method: 'POST',
        params: {contractNo, custRole}
    })
};

// 根据合同号码查询主共担详细信息
// contractBasic/contractDetail/custDetailInfoList?contractNo=N111111
export const custDetailInfoList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/custDetailInfoList`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询费用列表数据(去除费用)
export const findExpense = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/findExpense`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询罚息列表数据
export const findPenaltyInterest = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/findPenaltyInterest`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询还款计划表（应收）列表数据
export const findRepaymentPlan = (v) => {
    console.log(v);
    return axios.request({
        // url: `/contractBasic/contractDetailDedicated/findRepaymentPlan`,
        // url: `/contractBasic/repaymentPlanInfo/getRepaymentPlanList`,
        url: `/contractGateway/getRepaymentPlan`,
        method: 'POST',
        data: v,
    })
};
// 根据合同号码查询金融协议车款信息
export const financialAgreeByCar = (contractNo) => {
    return axios.request({
        url: `/contractBasic/financeInfo/financialAgreeByCar`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询应收数据
export const financialAgree = (contractNo) => {
    return axios.request({
        url: `/contractBasic/contractDetailDedicated/financialAgree`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询合同变更记录列表 contractManage/contractDetailManage/detail?contractNo=
export const logDetail = (contractNo) => {
    return axios.request({
        url: `/contractManage/contractDetailManage/lookLog`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据合同号码查询合同收款记录列表
export const getCollectionList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/receiptHandle/getReceiptList`,
        method: 'POST',
        params: {contractNo}
    })
};

// 根据收款来源id查询来源表数据
export const getDebitBatchDetails = (param) => {
    return axios.request({
        url: `/contractBasic/debitBatchDetails/getDebitBatchDetails`,
        method: 'POST',
        data: param
    })
};

// 根据收款来源id查询来源表数据
export const getAccountRegister = (param) => {
    return axios.request({
        url: `/contractManage/bankManagement/getAccountRegister`,
        method: 'POST',
        data: param
    })
};
